Background images and the ODS destination for PowerPoint

6
The SAS Programmer's PROC REPORT Handbook

Like all ODS destinations, the destination for PowerPoint uses table templates and style templates to display the tables, graphs, and other output produced by SAS procedures. Using the destination for PowerPoint in a SAS program is just like using any other ODS destination. You can customize the look of your presentation in a number of ways, including using custom ODS style templates or using images.
This blog post focuses on the use background images. The background in a PowerPoint slide is important. It often displays the company logo but it can also be used to add visual interest to a slide. Most importantly, the background should always complement the content of the slide and never distract the audience.
The BACKGROUNDIMAGE= suboption in the ODS POWERPOINT statement controls the background of slides generated by the ODS destination for PowerPoint.  With SAS 9.4TS1M3, and above, the background image can be changed for each slide, if you so desire.
This example uses a different background image for each of the slides.

ods powerpoint file='background1.pptx' options(backgroundimage='saslogo_pptx.png');
title 'SAS logo';
proc report data=sashelp.class(obs=5);
run;
 
ods powerpoint options(backgroundimage='orionstar_pptx.png');
title 'Orion Star logo';
proc report data=sashelp.orsales;
	column product_line quantity profit total_retail_price;
	define product_line / group;
	define quantity / format=comma10.;
	define profit / format=dollar12.;
	define total_retail_price / format=dollar12.;
run;
ods powerpoint close;

The key to using a background image for the ODS destination for PowerPoint is that it needs to be the same size (aspect ratio) of the presentation. For a 4:3 presentation (the default), consider creating the image with 1024 x 768 pixels. For a 10:9 (widescreen) presentation, consider creating the image with 1280 x 720 pixels.

For the background images in the example, I used an application that can create images and started with a blank canvas. I changed the size of the canvas to match the aspect ratio I needed. Then I inserted the smaller logo in the desired location.

Creating an image file with the correct aspect ratio is critical because the image will be stretched or shrunk to fit the area. This might create a background that is distracting because the image might be fuzzy or pixelated.

This example uses an image file that is only large enough to contain the logo. The result in the PowerPoint slide is a stretched, fuzzy image.

ods powerpoint file='background2.pptx' options(backgroundimage='saslogo.gif');
title 'small SAS logo';
proc report data=sashelp.class(obs=5);
run;
ods powerpoint close;

For more tips on using the ODS destination for PowerPoint, and especially getting PROC REPORT tables to fit in a slide, see my book The SAS® Programmer's PROC REPORT Handbook: ODS Companion.

If you enjoyed this tip or would like to learn more about new SAS books as they are published, sign up for our SAS Books Newsletter. The newsletter is the best way to stay up-to-date on our latest titles and learn more about special offers and discounts.

Share

About Author

Jane Eslinger

SAS Technical Support Analyst

Jane is a Technical Support Analyst at SAS Institute Inc., in Cary, NC. She supports the REPORT procedure, ODS, and other Base SAS procedures. Before she joined SAS, Jane worked as a statistical programmer in the social science and clinical research fields. She is a graduate of NC State University with a Bachelor of Science in Statistics.

Related Posts

6 Comments

  1. Hi Jane,

    I am a beginner in learning SAS . Could you please provide me your suggestions in learning statistics as i dont have it in my curriculum. Please provide my your inputs through email (priyanka22.teddy@gmail.com). your support is highly appreciated.

    Priyanka.

    • Jane Eslinger
      Jane Eslinger on

      Hello Priyanka,
      I recommend that you look through the SAS Training page. You will be able to find links to free tutorials, e-learning, and books that focus on statistics.

      Thanks,
      Jane

    • Jane Eslinger
      Jane Eslinger on

      Hi Meng,
      The images I reference in the code are not attached to this blog. You can replace my image names with the name of your own image files.

      Thanks,
      Jane

      • Hi Jane:
        I replaced then image names with then full name(include then image's path),but it doesn't .

        • Jane Eslinger
          Jane Eslinger on

          Xiaofang,
          Are you saying the images are not appearing in PowerPoint? Are you getting an error in the log? Which version of SAS are you using?
          Thanks,
          Jane

Back to Top